package com.lian.hope.mapper;

import com.lian.hope.model.po.ProjectsDonations;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;

import java.util.List;

@Mapper
public interface ProjectsDonationsMapper {
    @Select("insert into projects_donations (project_id,amount,user_id) values (#{projectId},#{amount},#{userId})")
    void insertDonations(ProjectsDonations projectsDonations);

    @Select("select project_id from projects_donations where user_id = #{userId}")
    List<Long> listDonationsProjectIdsByUserId(Long userId);
}
